package transaction.lcn.account.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import transaction.lcn.account.service.AccountService;
import transaction.lcn.common.entity.Result;
import transaction.lcn.common.tcc.WalletPayRequestVO;

@RestController
@RequestMapping("/lcn/account")
public class AccountController {

    @Autowired
    AccountService accountService;

    @GetMapping("debit")
    public Result debit(@RequestParam String userId, @RequestParam Integer orderMoney) {
        accountService.debit(userId, orderMoney);
        return new Result();
    }

    @PostMapping("debitTcc")
    public Object debitTcc(@RequestBody WalletPayRequestVO vo) {
        return accountService.doTryPay(vo);
    }
}
